package struct.intermediate.queue;

/**
 * @author MAX
 * @version 1.0
 * @description TODO
 * @date 2022/1/13 14:21
 */
public class ArrayLoopQueueTest {

    public static void main(String[] args) {
        ArrayLoopQueue<Integer> queue = new ArrayLoopQueue<>();

        int n = 10000000;

        long startTime = System.nanoTime();
        for (int i = 0; i < n; i++) {
            queue.enqueue(i);
        }

        for (int j = 0; j < n; j++) {
            queue.dequeue();
        }
        long endTime = System.nanoTime();
        double time = (endTime - startTime) / 1000000000.0;
        System.out.println("Array Queue cost time: " + time  + "s");
    }
}
